﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Portal.Database.Service;
using Portal.Core;
using Portal.Utility;
using Portal.Database.Utility;

namespace Portal.Web.Utility
{
    public class WebDatabaseService
    {
        public static IDatabaseService CreateDBService(string SiteId)
        {
            SiteParam OSiteParam = WebEnvironments.CreateSiteParam(SiteId);
            IDatabaseService Found= DBServiceUtilities.CreateDBService(OSiteParam, OSiteParam.DBServiceId, OSiteParam.ConnectionString);
            return Found;
        }


        public static IDatabaseService CreateDBService(string SiteId,string ConnectionString)
        {
            SiteParam OSiteParam = WebEnvironments.CreateSiteParam(SiteId);
            IDatabaseService Found = DBServiceUtilities.CreateDBService(OSiteParam, OSiteParam.DBServiceId, ConnectionString);
            return Found;
        }
    }
}
